#ifndef __DES_BYHX_H__
#define __DES_BYHX_H__

#ifdef __cplusplus
extern "C" {
#endif

/*! \ingroup algorithm
 *
 *  \defgroup des DES
 *  algorithm for BYHX code security
 * @{
 */

/* do des
 * \param	source		the data source address
 * \param	dest		the data destination address, can same as source address
 * \param	inkey		the DES key
 * \param	flg			0=en-security, 1=de-security
 */
void des(const unsigned char *source, unsigned char * dest, const unsigned char * inkey, int flg);

/*! Code de-security, destination address can same as source address
 * \param	pSrc		code source address
 * \param	pDest		code destination address
 * \param	len			code length to process
 */
void DeSecurity(const unsigned char * pSrc, unsigned char * pDest, int len);

/*! Code en-security, destination address can same as source address
 * \param	pSrc		code source address
 * \param	pDest		code destination address
 * \param	len			code length to process
 */
void EnSecurity(const unsigned char * pSrc, unsigned char * pDest, int len);

/*! data en-security, with specify key, destination address can same as source address
 * \param	pSrc		code source address
 * \param	pDest		code destination address
 * \param	len			code length to process
 * \param	desKey		the key for data en-security
 */
void en_security(const unsigned char * pSrc, unsigned char * pDest, int len, const unsigned char * desKey);

/*! data de-security, with specify key, destination address can same as source address
 * \param	pSrc		code source address
 * \param	pDest		code destination address
 * \param	len			code length to process
 * \param	desKey		the key for data de-security
 */
void de_security(const unsigned char * pSrc, unsigned char * pDest, int len, const unsigned char * desKey);

/*! @} */

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif // __DES_BYHX_H__
